<div class="row" style="margin: 0px">
	<div class="col-sm-12 mt-3" style="border-bottom: 10px solid #f7f8f9;padding-bottom: 1rem;">
		<h4 style="text-align: center;color: #17a2b8;margin-bottom: 0;">{{title}}</h4>
	</div>
</div>
<div class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
	<div class="col-sm-3 mt-3">
		<div class="input-group input-group-sm">
			<div class="input-group-prepend">
				<span class="input-group-text">仓库</span>
			</div>
			<input class="form-control" value="{{warehouse_show}}" type="text" readonly>
			<div class="input-group-append">
				<button class="btn btn-sm btn-success" type="button" x-ng-click="openSelectWarehouseModal()">选择</button>
			</div>
		</div>
	</div>
	<div class="col-sm-3 mt-3">
		<div class="input-group input-group-sm">
			<div class="input-group-prepend">
				<span class="input-group-text">类型</span>
			</div>
			<select class="custom-select" id="type">
				<option value="OUT" selected>申领</option>
				<option value="BORROW">借出</option>
			</select>
		</div>
	</div>
	<div class="col-sm-3 mt-3">
		<div class="input-group input-group-sm">
			<div class="input-group-prepend">
				<span class="input-group-text">账内账外</span>
			</div>
			<select class="custom-select" id="materiel_account_type">
				<option value="OUT" selected>账外</option>
				<option value="IN">账内</option>
			</select>
		</div>
	</div>
	<div class="col-sm-3 mt-3">
		<div class="input-group input-group-sm">
			<div class="input-group-prepend">
				<span class="input-group-text">审批方式</span>
			</div>
			<select class="custom-select" id="approval_type">
				<option value="COMMON" selected>正常</option>
				<option value="URGENT">紧急</option>
			</select>
		</div>
	</div>
	<div class="col-sm-12 mt-3 mb-3">
		<button x-ng-click="addStoreMaterielModal()" title="新增申领备件" type="button" class="btn btn-sm btn-outline-primary btn-block" style="margin: 2px;
			border-color: rgba(23,162,184,0.8);background-color: rgba(23,162,184,0.1) ;">
			<i class="fas fa-plus" style="color: rgba(23,162,184,1)">&nbsp;新增申领备件</i>
		</button><br/>
		<!--<button x-ng-click="showDes()" title="说明" type="button" class="btn btn-sm btn-outline-primary btn-block" style="margin: 2px;-->
			<!--border-color: rgba(23,162,184,0.8);background-color: rgba(23,162,184,0.1) ;">-->
			<!--<i class="fas fa-question" style="color: rgba(23,162,184,1)">&nbsp;说明</i>-->
		<!--</button><br/>-->
		<button x-ng-click="submitStore()" title="提交申领单" type="button" class="btn btn-sm btn-outline-primary btn-block" style="margin: 2px;
			border-color: rgba(23,162,184,0.8);background-color: rgba(23,162,184,0.1) ;">
			<i class="fas fa-check" style="color: rgba(23,162,184,1)">&nbsp;提交申领单</i>
		</button>
	</div>
</div>

<div class="row ng-scope" style="margin-left: 0px; margin-right: 0px; background-color: white;">
	<div class="col-12 mt-3">
		<table class="table table-sm table-hover table-bordered" style="border:0;">
			<tbody style="box-shadow: 0px 2px 10px 2px rgba(0,0,0,0.08);" x-ng-show="materiel_account_type === 'IN' && materiel_type === 'IN'" x-ng-repeat="obj in materiel_in_in_list track by $index">
				<tr>
					<th style="vertical-align: middle;width: 100px;color: #17a2b8;">编号</th>
					<td style="vertical-align: middle;">
						{{($index + 1)}}
					</td>
				</tr>
				<tr>	
					<th style="vertical-align: middle;">sp编号</th>
					<td style="vertical-align: middle;">
						{{obj.sp_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">批次号</th>
					<td>
						{{obj.batch_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">数量</th>
					<td>
						{{obj.num}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">硬件类型</th>
					<td>	
						{{obj.type_name}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">单位</th>
					<td>	
						{{obj.unit}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">操作</th>
					<td>
						<button x-ng-click="viewStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="查看详情">
							<i class="fas fa-eye" style="width: 15px;"></i>
						</button>
						&nbsp;
						<button x-ng-click="removeStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="移除">
							<i class="fas fa-minus" style="width: 15px;"></i>
						</button>
					</td>
				</tr>
			</tbody>

			<tbody style="box-shadow: 0px 2px 10px 2px rgba(0,0,0,0.08);" x-ng-show="materiel_account_type === 'IN' && materiel_type === 'BALANCE'" x-ng-repeat="obj in materiel_in_balance_list track by $index">
				<tr>
					<th style="vertical-align: middle;width: 100px;color: #17a2b8;">编号</th>
					<td style="vertical-align: middle;">
						{{($index + 1)}}
					</td>
				</tr>
				<tr>	
					<th style="vertical-align: middle;">sp编号</th>
					<td style="vertical-align: middle;">
						{{obj.sp_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">批次号</th>
					<td>
						{{obj.batch_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">数量</th>
					<td>
						{{obj.num}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">硬件类型</th>
					<td>	
						{{obj.type_name}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">单位</th>
					<td>	
						{{obj.unit}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">操作</th>
					<td>
						<button x-ng-click="viewStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="查看详情">
							<i class="fas fa-eye" style="width: 15px;"></i>
						</button>
						&nbsp;
						<button x-ng-click="removeStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="移除">
							<i class="fas fa-minus" style="width: 15px;"></i>
						</button>
					</td>
				</tr>
			</tbody>
			
			<tbody style="box-shadow: 0px 2px 10px 2px rgba(0,0,0,0.08);" x-ng-show="materiel_account_type === 'OUT' && materiel_type === 'IN'" x-ng-repeat="obj in materiel_out_in_list track by $index">
				<tr>
					<th style="vertical-align: middle;width: 100px;color: #17a2b8;">编号</th>
					<td style="vertical-align: middle;">
						{{($index + 1)}}
					</td>
				</tr>
				<tr>	
					<th style="vertical-align: middle;">sp编号</th>
					<td style="vertical-align: middle;">
						{{obj.sp_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">批次号</th>
					<td>
						{{obj.batch_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">数量</th>
					<td>
						{{obj.num}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">硬件类型</th>
					<td>	
						{{obj.type_name}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">单位</th>
					<td>	
						{{obj.unit}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">操作</th>
					<td>
						<button x-ng-click="viewStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="查看详情">
							<i class="fas fa-eye" style="width: 15px;"></i>
						</button>
						&nbsp;
						<button x-ng-click="removeStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="移除">
							<i class="fas fa-minus" style="width: 15px;"></i>
						</button>
					</td>
				</tr>
			</tbody>
			
			<tbody style="box-shadow: 0px 2px 10px 2px rgba(0,0,0,0.08);" x-ng-show="materiel_account_type === 'OUT' && materiel_type === 'BALANCE'" x-ng-repeat="obj in materiel_out_balance_list track by $index">
				<tr>
					<th style="vertical-align: middle;width: 100px;color: #17a2b8;">编号</th>
					<td style="vertical-align: middle;">
						{{($index + 1)}}
					</td>
				</tr>
				<tr>	
					<th style="vertical-align: middle;">sp编号</th>
					<td style="vertical-align: middle;">
						{{obj.sp_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">批次号</th>
					<td>
						{{obj.batch_code}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">数量</th>
					<td>
						{{obj.num}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">硬件类型</th>
					<td>	
						{{obj.type_name}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">单位</th>
					<td>	
						{{obj.unit}}
					</td>
				</tr>
				<tr>
					<th style="vertical-align: middle;">操作</th>
					<td>
						<button x-ng-click="viewStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="查看详情">
							<i class="fas fa-eye" style="width: 15px;"></i>
						</button>
						&nbsp;
						<button x-ng-click="removeStoreMateriel(obj.id)" class="btn btn-outline-success btn-sm" type="button" title="移除">
							<i class="fas fa-minus" style="width: 15px;"></i>
						</button>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>

<!-- 弹出选择备件相关信息的modal -->
<div class="modal" id="addStoreMaterielModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">添加备件</h5>
				<button type="button" x-ng-click="closeStoreMaterielModal()" class="close" title="关闭">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div class="row">
					<div class="col-sm-12">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">类型</div>
							</div>
							<input type="text" class="form-control" value="{{materiel_account_type === 'IN' ? '账内' : '账外'}}/{{type === 'OUT' ? '出库' : '借出'}}" readonly="readonly" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">CP号</div>
							</div>
							<input type="text" class="form-control" x-ng-model="bind_info.sp_code" placeholder="请选择CP号" readonly="readonly" />
							<div class="input-group-append">
								<button class="btn btn-sm btn-success" type="button" x-ng-click="openSelectSpModal()">选择</button>
							</div>
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">批次号</div>
							</div>
							<input type="text" class="form-control" x-ng-model="bind_info.batch_code" placeholder="请选择批次号" readonly="readonly" />
							<div class="input-group-append">
								<button class="btn btn-sm btn-success" type="button" x-ng-click="openSelectBatchModal()">选择</button>
							</div>
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">硬件类型</div>
							</div>
							<input type="text" class="form-control" readonly="readonly" x-ng-model="bind_info.type_view" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">单位</div>
							</div>
							<input type="text" class="form-control" readonly="readonly" x-ng-model="bind_info.unit" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">申领数量</div>
							</div>
							<input id="number" type="number" class="form-control" x-ng-model="bind_info.num" placeholder="请输入数量" />
						</div>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" id="subBtn" x-ng-click="addStoreMateriel()" class="btn btn-sm btn-default" title="提交">
					<i class="fas fa-check"></i>
				</button>
			</div>
		</div>
	</div>
</div>



<!-- 弹出选择SP号的modal -->
<div class="modal" id="selectSpModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">选择CP号</h5>
				<button type="button" class="close" ng-click="clearText('selectSpModal')">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
					<div class="col-sm-4 mt-3 mb-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<span class="input-group-text">名称</span>
							</div>
							<input type="text" class="form-control" x-ng-model="spSearch.spName" placeholder="请输入名称">
						</div>
					</div>
					<div class="col-sm-4 mt-3 mb-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<span class="input-group-text">SP编号</span>
							</div>
							<input type="text" class="form-control" x-ng-model="spSearch.spCode" placeholder="请输入SP编号">
						</div>
					</div>
					<div class="col-sm-4 mt-3 mb-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<span class="input-group-text">分类类型</span>
							</div>
							<select class="custom-select" x-ng-model="spSearch.type">
								<option value="" selected>请选择</option>
								<option value="RFID">RFID</option>
								<option value="QR">二维码</option>
								<option value="WEIGHT">称重</option>
							</select>
						</div>
					</div>
					<div class="col-sm-4 mt-3 mb-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<span class="input-group-text">能否借用</span>
							</div>
							<select class="custom-select" x-ng-model="spSearch.borrow">
								<option value="" selected>请选择</option>
								<option value="CAN">可以借用</option>
								<option value="CANT">不可借用</option>
							</select>
						</div>
					</div>
					<div class="col-sm-4 mt-3 mb-3">
						<button x-ng-click="spPageSearch()" title="搜索" type="button"
								class="btn btn-sm btn-outline-primary">
							<i class="fas fa-search"></i>
						</button>
					</div>
				</div>
				<div id="spTable" class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
				</div>
			</div>
			<div class="modal-footer">
				&nbsp;
			</div>
		</div>
	</div>
</div>

<!-- 弹出选择批次号的modal -->
<div class="modal" id="selectBatchModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">选择批次号</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div id="batchTable" class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
				</div>
			</div>
			<div class="modal-footer">
				&nbsp;
			</div>
		</div>
	</div>
</div>

<!-- 弹出选择货位的modal -->
<div class="modal" id="selectShelfModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">选择货位</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<ul id="shelfTree" style="height: 400px;overflow: scroll;" class="ztree"></ul>
			</div>
			<div class="modal-footer">
				<button type="button" x-ng-click="callBackSelectShelfModal()" class="btn btn-sm btn-default" title="提交">
					<i class="fas fa-check"></i>
				</button>
			</div>
		</div>
	</div>
</div>

<!-- 弹出选择rfid标签的modal -->
<div class="modal" id="selectRfidModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">选择备件</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div id="rfidTable" class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" x-ng-click="callBackSelectRfidModal()" class="btn btn-sm btn-default" title="提交">
					<i class="fas fa-check"></i>
				</button>
			</div>
		</div>
	</div>
</div>

<!-- 弹出选择二维码标签的modal -->
<div class="modal" id="selectQrModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">选择二维码标签</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div id="qrTable" class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" x-ng-click="callBackSelectQrModal()" class="btn btn-sm btn-default" title="提交">
					<i class="fas fa-check"></i>
				</button>
			</div>
		</div>
	</div>
</div>

<!-- 弹出选择仓库的modal -->
<div class="modal" id="selectWarehouseModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">选择申领仓库</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div id="warehouseTable" class="row" style="margin-left: 0px; margin-right: 0px; background-color: white;">
				</div>
			</div>
			<!--<div class="modal-footer">-->
				<!--<button type="button" x-ng-click="callBackSelectWarehouseModal()" class="btn btn-sm btn-default" title="提交">-->
					<!--<i class="fas fa-check"></i>-->
				<!--</button>-->
			<!--</div>-->
		</div>
	</div>
</div>

<!-- 弹出选择称重筐的modal -->
<div class="modal" id="selectBasketModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">选择物料盒</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<ul id="weighTree" style="height: 400px;overflow: scroll;" class="ztree"></ul>
			</div>
			<div class="modal-footer">
				<button type="button" x-ng-click="callBackSelectBasketModal()" class="btn btn-sm btn-default" title="提交">
					<i class="fas fa-check"></i>
				</button>
			</div>
		</div>
	</div>
</div>

<!-- 查看当前已添加到入库单中的备件信息 -->
<div class="modal" id="viewMaterielModal" tabindex="-1">
	<div class="modal-dialog modal-dialog-centered modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title">查看备件信息</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div class="row">
					<div class="col-sm-12">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">类型</div>
							</div>
							<input type="text" class="form-control" value="{{materiel_account_type === 'IN' ? '账内' : '账外'}}/{{type === 'OUT' ? '出库' : '借出'}}" readonly="readonly" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">CP号</div>
							</div>
							<input type="text" class="form-control" x-ng-model="materielViewObj.sp_code" readonly="readonly" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">批次号</div>
							</div>
							<input type="text" class="form-control" x-ng-model="materielViewObj.batch_code" readonly="readonly" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">硬件类型</div>
							</div>
							<input type="text" class="form-control" x-ng-model="materielViewObj.type_name" readonly="readonly" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">单位</div>
							</div>
							<input type="text" class="form-control" x-ng-model="materielViewObj.unit" readonly="readonly" />
						</div>
					</div>
					<div class="col-sm-12 mt-3">
						<div class="input-group input-group-sm">
							<div class="input-group-prepend">
								<div class="input-group-text">新增数量</div>
							</div>
							<input type="number" class="form-control" x-ng-model="materielViewObj.num" readonly="readonly" />
						</div>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-sm btn-default">
					<i class="fas fa-check"></i>
				</button>
			</div>
		</div>
	</div>
</div>